package com.ruibang.glass.purchase.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 采购到货单表
 * </p>
 *
 * @author mameng
 * @since 2024-03-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "采购到货单表")
@TableName(value = "g_purchase_arrival_orders")
public class PurchaseArrivalOrders extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "序号")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "采购到货单号")
    private String purchaseArrivalOrderNumber;

    @ApiModelProperty(value = "采购订单号")
    private String purchaseOrderNumber;

    @ApiModelProperty(value = "仓储入库状态")
    private String warehousingStatus;

    @ApiModelProperty(value = "项目编号")
    private String projectNumber;

    @ApiModelProperty(value = "合同编号")
    private String contractNumber;

    @ApiModelProperty(value = "合同id")
    private String contractId;

    @ApiModelProperty(value = "到货确认人")
    private String arrivalConfirmUser;

    @ApiModelProperty(value = "到货确认人Id")
    private String arrivalConfirmUserId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime creationTime;

    @ApiModelProperty(value = "验收人")
    private String inspector;

    @ApiModelProperty(value = "验收人ID")
    private String inspectorId;

    @ApiModelProperty(value = "供应商名称")
    private String supplierName;

    @ApiModelProperty(value = "供应商ID")
    private String supplierId;

    @ApiModelProperty(value = "质检状态")
    private String qualityInspectionStatus;

    @ApiModelProperty(value = "入库状态")
    private String status;

    @ApiModelProperty(value = "到货备注")
    private String remarksArrival;

    @ApiModelProperty(value = "物品名称")
    private String itemName;

    @ApiModelProperty(value = "类型")
    private String itemType;

    @ApiModelProperty(value = "规格")
    private String specification;

    @ApiModelProperty(value = "批次号")
    private String batchNumber;

    @ApiModelProperty(value = "单价")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "数量")
    private Double quantity;

    @ApiModelProperty(value = "总价")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "单位")
    private String unitOfMeasure;

    @ApiModelProperty(value = "生产日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private LocalDate productionDate;

    @ApiModelProperty(value = "其他备注")
    private String additionalRemarks;

    @ApiModelProperty(value = "良品数")
    private Integer goodProduct;

    @ApiModelProperty(value = "不良品数")
    private Integer badProduct;

    @ApiModelProperty(value = "质检状态 1:全部质检, 0:未质检")
    private Integer checkStatus;

    @TableField(exist = false)
    private List<String> fileIds;

    @TableField(exist = false)
    private String processId;

    @ApiModelProperty(value = "审批状态")
    @TableField(exist = false)
    private String approveStatus;

    @ApiModelProperty(value = "审批节点")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUser;

    @TableField(exist = false)
    private String menuId;

    @ApiModelProperty(value = "产品")
    @TableField(exist = false)
    private List<PurchaseArrivalProduct> purchaseArrivalProducts;

    @ApiModelProperty(value = "是否可修改质检结果 0:否,1:是")
    @TableField(exist = false)
    private String isResultChanged;

    @ApiModelProperty(value = "申请人")
    private String applicant;

    @ApiModelProperty(value = "申请人")
    private String applicantId;


    @ApiModelProperty(value = "物料名称")
    @TableField(exist = false)
    private String itemCode;

    @ApiModelProperty(value = "条码号")
    @TableField(exist = false)
    private String barcodeNumber;


}
